package com.mingtu.guards.adapter;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.StringUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mingtu.guards.R;
import com.mingtu.guards.bean.ApproveListBean;

public class ApproveAdapter extends BaseQuickAdapter<ApproveListBean.PageBean.ListBean, BaseViewHolder> {

    public ApproveAdapter() {
        super(R.layout.item_approve);

    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, ApproveListBean.PageBean.ListBean listBean) {
        String title = listBean.getAuditName();
        String userName = listBean.getApplyUserName();
        String createTime = listBean.getCreateTime();
        if (!StringUtils.isEmpty(title)) {
            helper.setText(R.id.tv_type, "审批类型：" + title);
        }
        if (!StringUtils.isEmpty(userName)) {
            helper.setText(R.id.tv_name, "申请人：" + userName);
        }
        if (!StringUtils.isEmpty(createTime)) {
            helper.setText(R.id.tv_time, "申请时间：" + createTime);
        }
    }
}
